package com.ccl.iot.batch;

import android.app.Activity;
import android.os.Bundle;

import com.ccl.iot.publics.Messager;
import com.ccl.iot.managers.BatchManager;
import com.ccl.iot.R;

public class ShortcutMode extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        finish();

        long id = getIntent().getLongExtra("_ID", 0);
        if (id != 0) {
            BatchManager bm = BatchManager.GetDefaultManager(getBaseContext());

            if (bm != null) {
                boolean result = bm.executeBatch(id);
                if (result) {
                    Messager.Show(getString(R.string.Exe_Success));
                } else {
                    Messager.Show(getString(R.string.Exe_Faild));
                }
            } else {
                Messager.Show(getString(R.string.Exe_Faild));
            }
        }

    }

}
